
export const incerment=()=>({
	type:"incerment",data:10
})

//异步action action的值为函数
export const async_count=()=> {

	return (dispatch:Function)=> {
		setTimeout(() => {
			dispatch(incerment())
		}, 1000)
	}
}




// Thunk 函数
export async function initFunc(dispatch:Function,getState:Function ) {
	let state = getState();
	console.log('Todos before dispatch: ', state)
	dispatch({ type: 'initFun', data: 5000 })
	console.log('Todos after dispatch: ', getState())
}